import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common';
import { CoralClassService } from './coral-class.service';
import { CreateCoralClassDto } from './dto/create-coral-class.dto';
import { UpdateCoralClassDto } from './dto/update-coral-class.dto';
import { Public } from 'src/auth/utils/public.metadata';

@Controller('coral-class')
export class CoralClassController {
  constructor(private readonly coralClassService: CoralClassService) {}

  @Post('create')
  create(@Body() createCoralClassDto: CreateCoralClassDto) {
    return this.coralClassService.create(createCoralClassDto);
  }

  @Public()
  @Get('list')
  findAll() {
    return this.coralClassService.findAll();
  }

  @Patch(':id')
  update(
    @Param('id') id: string,
    @Body() updateCoralClassDto: UpdateCoralClassDto,
  ) {
    return this.coralClassService.update(+id, updateCoralClassDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.coralClassService.remove(+id);
  }
}
